package com.goodwill.androidtest;

public class NumTest {
    public static void main(String[] args) {
        int num = 10;
        System.out.println("初始原始数：" + num);
        System.out.println("初始数二进制：" + Integer.toBinaryString(num));
        System.out.println("初始数八进制：" + Integer.toOctalString(num));
        System.out.println("初始数十六进制：" + Integer.toHexString(num));
        num = num << 3;
        System.out.println("左移的数：" + Integer.toBinaryString(num));
        num = num >> 1;
        System.out.println("右移的数：" + Integer.toBinaryString(num));

        //取反运算符
        String url = "https://www.baidu.com/video/2322.mp4";
        int index = url.indexOf("video");
        System.out.println("index:" + index);
        int new_index = ~url.indexOf("video");
        System.out.println("new_index:" + new_index);
    }
}
